package com.scjp.chapter3.layout_example;

class Layout { // class

	static int s = 343; // static variable
	static int x; // instance variable

	{
		x = 7; // x is 0 in doStuff and in Main
	} // initialization block

	Layout() {
		x += 8; // x is 0 in doStuff and in Main
	} // constructor

	static void doStuff() { // method
		int y = 0; // local variable
		System.out.println("How is x ? : " + x);
		for (int z = 0; z < 4; z++) { // 'for' code block
			y += z + x;
		}
		System.out.println("y = " + y);
		System.out.println("Final x ? : " + x);
	}

	public static void main(String[] args) {
		System.out.println("s = " + s);
		System.out.println("x = " + x);
		Layout.doStuff();
	}
}